【Nginx】Linux常用命令 | 您所在的位置:网站首页 › linux nginx 关闭命令 › 【Nginx】Linux常用命令 |
启动
启动代码格式:nginx安装目录地址 -c nginx配置文件地址 例如: [root@LinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 停止nginx的停止有三种方式: 从容停止1、查看进程号 [root@LinuxServer ~]# ps -ef|grep nginx 2、杀死进程 [root@LinuxServer ~]# kill -QUIT 2072 快速停止1、查看进程号 [root@LinuxServer ~]# ps -ef|grep nginx 2、杀死进程 [root@LinuxServer ~]# kill -TERM 2132 或 [root@LinuxServer ~]# kill -INT 2132 强制停止[root@LinuxServer ~]# pkill -9 nginx 重启1、验证nginx配置文件是否正确 方法一:进入nginx安装目录sbin下,输入命令./nginx -t 看到如下显示nginx.conf syntax is ok nginx.conf test is successful 说明配置文件正确! 方法二:在启动命令-c前加-t 2、重启Nginx服务 方法一:进入nginx可执行目录sbin下,输入命令./nginx -s reload 即可 方法二:查找当前nginx进程号,然后输入命令:kill -HUP 进程号 实现重启nginx服务 ———————————————— pgrep /pkill EXAMPLES Example 1: Find the process ID of the named daemon: $ pgrep -u root named Example 2: Make syslog reread its configuration file: $ pkill -HUP syslogd Example 3: Give detailed information on all xterm processes: $ ps -fp $(pgrep -d, -x xterm) Example 4: Make all netscape processes run nicer: $ renice +4 $(pgrep netscape) 验证配置是否正确: nginx -t 查看Nginx的版本号:nginx -V 启动Nginx:start nginx 快速停止或关闭Nginx:nginx -s stop 正常停止或关闭Nginx:nginx -s quit 配置文件修改重装载命令:nginx -s reload 1、错误情况: nginx: [error] CreateFile() “E:\nginx\nginx-1.9.3/logs/nginx.pid” failed nginx: [error] Open() “E:\nginx\nginx-1.9.3/logs/nginx.pid” failed 使用命令创建/logs/nginx.pid文件: nginx -c conf/nginx.conf 相关文档说明: http://www.cnblogs.com/wangkongming/p/4004416.html http://www.cnblogs.com/xiaogangqq123/archive/2011/03/02/1969006.html 2、配置多个80端口 server: 相关文档说明: http://os.51cto.com/art/201404/437182.htm 3、不同端口为本地nginx服务器配置多个站点: 相关文档说明: http://blog.csdn.net/yongzhang52545/article/details/51282914 http://www.2cto.com/os/201411/355976.html |
CopyRight 2018-2019 实验室设备网 版权所有 |